{$CLEO .cs}
0000:

const
sneaky_move   = 0@
metal_gear_style    = 1@
being_chased =  2@ 
Manhunt =  3@ 
Manhunt_alert =  4@ 
Manhunt_alert_v2 =  5@ 
Manhunt_alert_mixed =  6@ 
being_chased_mixed = 7@ 
being_chased_heavy = 8@ 

end 


sneaky_move = audiostream.Load("cleo\surival_game\@Stealthy_Spy.mp3")
audiostream.Loop( sneaky_move , 1 )
metal_gear_style = audiostream.Load("cleo\surival_game\@stealthy_rolling_secret_agent.mp3")
audiostream.Loop( metal_gear_style , 1 )
being_chased = audiostream.Load("cleo\surival_game\@Stealthy_alert.mp3")
audiostream.Loop( being_chased , 1 )

Manhunt = audiostream.Load("cleo\surival_game\@stealthy_manhunt.mp3")
audiostream.Loop( Manhunt , 1 )

Manhunt_alert = audiostream.Load("cleo\surival_game\@stealthy_manhunt_alert_full.mp3")
audiostream.Loop( Manhunt_alert , 1 )

Manhunt_alert_v2 = audiostream.Load("cleo\surival_game\@Stealthy_army_danger.mp3")
audiostream.Loop( Manhunt_alert_v2 , 1 )

Manhunt_alert_mixed = audiostream.Load("cleo\surival_game\@stealthy_manhunt_mixed.mp3")
audiostream.Loop( Manhunt_alert_mixed , 1 )

being_chased_mixed = audiostream.Load("cleo\surival_game\@stealthy_spy_mixed.mp3")
audiostream.Loop( being_chased_mixed , 1 )

being_chased_heavy = audiostream.Load("cleo\surival_game\@Stealthy_army_danger.mp3")
audiostream.Loop( being_chased_heavy , 1 )
 
            audiostream.Volume( manhunt_alert ) = 0.0 
            audiostream.Volume( manhunt_alert_v2 ) = 0.0 
            audiostream.Volume( Manhunt_alert_mixed ) = 0.0 
            audiostream.Volume( being_chased_mixed ) = 0.0 
                                 
            audiostream.Volume( 1@ ) = 1.0 
            audiostream.Volume( 2@ ) = 1.0 
            audiostream.Volume( 3@ ) = 1.0     

while $onmission >= 1 
wait 0 
if   
  test_cheat "music1"
then
   $MUSIC_NUMBER_SELECTED = 1 
   show_text_highpriority "Music enabled" 3000
    gosub @MUSIC_STOP_ALL
   wait 250
end 
if   
  test_cheat "music2"
then
   $MUSIC_NUMBER_SELECTED = 2 
   show_text_highpriority "Music enabled sneaky mode" 3000
    gosub @MUSIC_STOP_ALL
   wait 250
end 
if   
  test_cheat "music3"
then
   $MUSIC_NUMBER_SELECTED = 3 
   show_text_highpriority "Music enabled dynamic style" 3000
    gosub @MUSIC_STOP_ALL
   wait 250
end 
if   
  test_cheat "music4"
then
   $MUSIC_NUMBER_SELECTED = 4 
   show_text_highpriority "Manhunt v2 style" 3000
   
    gosub @MUSIC_STOP_ALL
     audiostream.PerformAction(  manhunt_alert_v2 , play )
     audiostream.PerformAction(  manhunt_alert_mixed , play )
     audiostream.PerformAction(  manhunt , play  )
     audiostream.PerformAction(  manhunt_alert  , play  )      
   wait 250
end 
if   
  test_cheat "music5"
then
   $MUSIC_NUMBER_SELECTED = 5 
   show_text_highpriority "Stealthy v3 style" 3000
    
         0AB9: get_audio_stream being_chased state_to 31@ 
         audiostream.Volume( being_chased ) = 1.0 
         audiostream.Volume( being_chased_HEAVY ) = 1.0 
         audiostream.Volume( Manhunt_alert ) = 1.0    
         audiostream.Volume( metal_gear_style ) = 1.0                 


            audiostream.Volume( metal_gear_style ) = 1.0 
            audiostream.Volume( being_chased ) = 1.0     
     
           
    gosub @MUSIC_STOP_ALL 
   wait 250
   
     audiostream.PerformAction( metal_gear_style , play )
     audiostream.PerformAction( being_chased , play  )     
     audiostream.PerformAction( being_chased_HEAVY , play  )     
     audiostream.PerformAction( manhunt_alert , play  )     
   
end 
if   
  test_cheat "music6"
then
   $MUSIC_NUMBER_SELECTED = 6 
   show_text_highpriority "Manhunt Classic style" 3000  
    gosub @MUSIC_STOP_ALL
   wait 250
end 
if   
  test_cheat "music7"
then
   $MUSIC_NUMBER_SELECTED = 7 
   show_text_highpriority "Speaky v2 style" 3000  
    gosub @MUSIC_STOP_ALL
   wait 250
end 
if  
  test_cheat "music0"
then
   $MUSIC_NUMBER_SELECTED = 0  
     audiostream.PerformAction( sneaky_move , stop  )
     audiostream.PerformAction( metal_gear_style , stop )
     audiostream.PerformAction( being_chased , stop  )  
      gosub @MUSIC_STOP_ALL 
   show_text_highpriority "Music disabled" 3000
   wait 250
end 
//A 
  if $MUSIC_NUMBER_SELECTED == 1 
  then 
      0AB9: get_audio_stream metal_gear_style state_to 31@ 
      
      if 31@ == 0 
      then
         audiostream.PerformAction(  being_chased , play  )
         audiostream.PerformAction(  metal_gear_style  , play  )  
      end   
     if $WAVE >= 1 
     then
     audiostream.PerformAction( sneaky_move , pause )
     audiostream.PerformAction( metal_gear_style , pause )
     audiostream.PerformAction( being_chased , resume  )
 
     
     else 
     
     audiostream.PerformAction( sneaky_move , pause )
     audiostream.PerformAction( metal_gear_style , resume )
     audiostream.PerformAction( being_chased , pause  )
     
     end
   end
//B   sneaky
  if $MUSIC_NUMBER_SELECTED == 2  
  then 
      0AB9: get_audio_stream sneaky_move state_to 31@ 
      
      if 31@ == 0 
      then
         audiostream.PerformAction(  being_chased_heavy , play  )
         audiostream.PerformAction(  sneaky_move  , play  )  
      end  
     if $WAVE >= 1 
     then
     audiostream.PerformAction( sneaky_move , pause )
     audiostream.PerformAction( metal_gear_style , pause )
     audiostream.PerformAction( being_chased_heavy , resume  )

     
     
     else 
     
     audiostream.PerformAction( sneaky_move , resume )
     audiostream.PerformAction( metal_gear_style , stop )
     audiostream.PerformAction( being_chased_heavy , stop  )
     
     end
   end

  if $MUSIC_NUMBER_SELECTED == 3 //dynamic
  then 
  
     if $MISSION_MUSIC_IS_ACTIVE == 2
     then
         if  
         $WAVE >= 1  
         then
         audiostream.PerformAction( sneaky_move , pause )
         audiostream.PerformAction( metal_gear_style , pause )
         audiostream.PerformAction( being_chased , resume  )
    
         
         
         else 
         
         audiostream.PerformAction( sneaky_move , resume )
         audiostream.PerformAction( metal_gear_style , stop )
         audiostream.PerformAction( being_chased , stop  )
         
         end     
     end
     if $MISSION_MUSIC_IS_ACTIVE == 0 
     then
         if $WAVE >= 1 
         then
         audiostream.PerformAction( sneaky_move , stop )
         audiostream.PerformAction( metal_gear_style , stop )
         audiostream.PerformAction( being_chased , resume  )
    
         
         
         else 
         
         audiostream.PerformAction( sneaky_move , stop )
         audiostream.PerformAction( metal_gear_style , stop )
         audiostream.PerformAction( being_chased , stop  )
         
         end          
     end 
   end


  if $MUSIC_NUMBER_SELECTED == 4   // MANHUNT
  then  
 //  0086: manhunt_alert_v2 = $crime_rate // (float)
  0AB9: get_audio_stream Manhunt state_to 31@ 
  
  if 31@ == 0 
  then
     audiostream.PerformAction(  manhunt_alert_v2 , play )
   //  audiostream.PerformAction(  manhunt_alert_mixed , play )
     audiostream.PerformAction(  manhunt , play  )
     audiostream.PerformAction(  manhunt_alert  , play  )  
  end 
     if $WAVE >= 1 
     then                                                {
     audiostream.PerformAction(  manhunt_alert_v2 , pause )
     audiostream.PerformAction(  manhunt_alert_mixed , pause )
     audiostream.PerformAction(  manhunt , pause  )
     audiostream.PerformAction(  manhunt_alert  , resume  )
                                                              }
    // audiostream.Volume( manhunt_alert_mixed ) = 0.0 
         audiostream.Volume( manhunt ) = 0.0 
         if  
         $WAVE >= 6
         
         then
         audiostream.Volume( manhunt_alert_v2 ) = 1.0 
         audiostream.Volume( manhunt_alert ) = 0.0      
         
         else 
         audiostream.Volume( manhunt_alert_v2 ) = 0.0 
         audiostream.Volume( manhunt_alert ) = 1.0      
         
         end
     else 
    // audiostream.Volume( manhunt_alert_v2 ) = 0.0 
    // audiostream.Volume( manhunt_alert_mixed ) = 0.0 
      audiostream.Volume( manhunt_alert_v2 ) = 0.0 
         if $WAVE == 0 
         then
         audiostream.Volume( manhunt ) = 1.0
             if and
             $crime_rate >= 140.0
             $crime_rate  < 200.0
             then
              
             audiostream.Volume( manhunt_alert ) = 0.7  
 
              
             end 
             if  and
             $crime_rate >= 70.0
             $crime_rate < 140.0
             then
              audiostream.Volume( manhunt_alert ) = 0.4 
   

             end    
             if  and
             $crime_rate >= 25.0
             $crime_rate < 70.0
             then
              audiostream.Volume( manhunt_alert ) = 0.2 
   

             end     
             if 
             $crime_rate < 25.0
             then
              audiostream.Volume( manhunt_alert ) = 0.0  
             end    
         end 
     
     {
     audiostream.PerformAction(  manhunt_alert_v2 , pause )
     audiostream.PerformAction(  manhunt_alert_mixed , pause )
     audiostream.PerformAction(  manhunt , resume  )
     audiostream.PerformAction(  manhunt_alert  , pause  )
                                                             }
     end
   end


  if $MUSIC_NUMBER_SELECTED == 5   // V2
  then  
  
      
      

  
 //  0086: manhunt_alert_v2 = $crime_rate // (float)
      
     if $WAVE >= 1 
     then                                          
         audiostream.Volume( metal_gear_style ) = 0.0                 
         IF $WAVE < 5
         THEN
         0AB9: get_audio_stream being_chased state_to 31@ 
         audiostream.Volume( being_chased ) = 1.0 
         audiostream.Volume( being_chased_HEAVY ) = 0.0 
         audiostream.Volume( Manhunt_alert ) = 0.0 
         AUDIOSTREAM.PerformAction(  Manhunt_alert , STOP )
         AUDIOSTREAM.PerformAction(  being_chased_HEAVY , STOP )         
         END
         if   AND 
         $WAVE >= 5
         $WAVE <  8
         then     
         0AB9: get_audio_stream Manhunt_alert state_to 31@ 
         audiostream.Volume( being_chased ) = 0.0 
         audiostream.Volume( being_chased_HEAVY ) = 0.0 
         audiostream.Volume( Manhunt_alert ) = 1.0 
         AUDIOSTREAM.PerformAction(  Manhunt_alert , RESUME )
         AUDIOSTREAM.PerformAction(  being_chased_HEAVY , STOP )
         end   
         if   AND 
         $WAVE >= 8
         $WAVE <  13
         then  
         0AB9: get_audio_stream being_chased_HEAVY state_to 31@    
         audiostream.Volume( being_chased ) = 0.0 
         audiostream.Volume( being_chased_HEAVY ) = 1.0 
         audiostream.Volume( Manhunt_alert ) = 0.0 
         AUDIOSTREAM.PerformAction(  Manhunt_alert , STOP )
         AUDIOSTREAM.PerformAction(  being_chased_HEAVY , RESUME )
         end   
         
     else     
         AUDIOSTREAM.PerformAction(  Manhunt_alert , STOP )
         AUDIOSTREAM.PerformAction(  being_chased_HEAVY , STOP )        
         audiostream.Volume( being_chased_HEAVY ) = 0.0 
         audiostream.Volume( Manhunt_alert ) = 0.0                
         if $WAVE == 0 
         then 
         0AB9: get_audio_stream metal_gear_style state_to 31@ 
            audiostream.Volume( metal_gear_style ) = 1.0 
             if and
             $crime_rate >= 140.0
             $crime_rate  < 200.0
             then
              
             audiostream.Volume( being_chased ) = 0.7  
 
              
             end 
             if  and
             $crime_rate >= 70.0
             $crime_rate < 140.0
             then
              audiostream.Volume( being_chased ) = 0.4 
   

             end    
             if  and
             $crime_rate >= 25.0
             $crime_rate < 70.0
             then
              audiostream.Volume( being_chased ) = 0.2 
   

             end    
             if 
             $crime_rate < 25.0
             then
              audiostream.Volume( being_chased ) = 0.0  
             end  
         end 
      
     end
      if 31@ == 0 
      then
         audiostream.PerformAction(  being_chased , play  )
         audiostream.PerformAction(  metal_gear_style  , play  )  
         audiostream.PerformAction(  being_chased_HEAVY  , play  )  
         audiostream.PerformAction(  Manhunt_alert  , play  )  
      end      
   end
 
 
  if $MUSIC_NUMBER_SELECTED == 6  
  then 
      0AB9: get_audio_stream manhunt state_to 31@ 
      
      if 31@ == 0 
      then
         audiostream.PerformAction(  manhunt_alert , play  )
         audiostream.PerformAction(  manhunt_alert_v2  , play  )  
         audiostream.PerformAction(  manhunt  , play  )  
      end     
     if and
     $WAVE >= 1 
     $WAVE <  6  
     then
     audiostream.PerformAction( manhunt , pause )
     audiostream.PerformAction(  manhunt_alert , resume )
     audiostream.PerformAction(  manhunt_alert_v2 ,  pause )
  
     end
     if $WAVE <= 0 
     then 
 
     audiostream.PerformAction(  manhunt , resume )
     audiostream.PerformAction(  manhunt_alert ,  pause)
     audiostream.PerformAction(  manhunt_alert_v2 ,  pause )
     
     end
     if $WAVE >= 6 
     then 
 
     audiostream.PerformAction(  manhunt , pause )
     audiostream.PerformAction(  manhunt_alert ,  pause)
     audiostream.PerformAction(  manhunt_alert_v2 ,  resume )
     
     end
   end   
   
   
  if $MUSIC_NUMBER_SELECTED == 7   // V2
  then  
      0AB9: get_audio_stream sneaky_move state_to 31@ 
      
      if 31@ == 0 
      then
         audiostream.PerformAction(  sneaky_move , play  )
         audiostream.PerformAction(  being_chased_heavy  , play  )  
      end 
  
 //  0086: manhunt_alert_v2 = $crime_rate // (float)
      
     if $WAVE >= 1 
     then                                               
       audiostream.Volume( being_chased_heavy ) = 1.0 
       audiostream.Volume( sneaky_move ) = 0.0 
                         
   
     else    
     
         if $WAVE == 0 
         then 
            audiostream.Volume( sneaky_move ) = 1.0 
             if and
             $crime_rate >= 140.0
             $crime_rate  < 200.0
             then
              
             audiostream.Volume( being_chased_heavy ) = 0.7  
 
              
             end 
             if  and
             $crime_rate >= 70.0
             $crime_rate < 140.0
             then
              audiostream.Volume( being_chased_heavy ) = 0.4 
   

             end    
             if  and
             $crime_rate >= 25.0
             $crime_rate < 70.0
             then
              audiostream.Volume( being_chased_heavy ) = 0.2 
   

             end    
             if 
             $crime_rate < 25.0
             then
              audiostream.Volume( being_chased_heavy ) = 0.0  
             end  
         end 
      
     end
   end   
end 
audiostream.Release( 0@ )
audiostream.Release( 1@ )
audiostream.Release( 2@ )
audiostream.Release( 3@ )
audiostream.Release( 4@ )
audiostream.Release( 5@ )
audiostream.Release( 6@ )
audiostream.Release( 7@ )
audiostream.Release( 8@ )
0A95: save_this_custom_script

0A93: terminate_this_custom_script
:MUSIC_STOP_ALL
 audiostream.PerformAction( 1@ , stop )
 audiostream.PerformAction( 2@ , stop )
 audiostream.PerformAction( 3@ , stop  )
 audiostream.PerformAction( 4@ , stop  )
 audiostream.PerformAction( 5@ , stop  )
 audiostream.PerformAction( 6@ , stop  )
 audiostream.PerformAction( 7@ , stop  ) 
 audiostream.PerformAction( 8@ , stop  ) 
 {
    audiostream.Volume( 1@ ) = 1.0 
    audiostream.Volume( 2@ ) = 1.0 
    audiostream.Volume( 3@ ) = 1.0     
    audiostream.Volume( 4@ ) = 1.0     
    audiostream.Volume( 5@ ) = 1.0     
    audiostream.Volume( 6@ ) = 1.0     
    audiostream.Volume( 7@ ) = 1.0      
                                    }
return 